﻿using System;
using System.Xml;

namespace octalforty.Syndication.Core
{
    /// <summary>
    /// Defines a contract for an aggregator, which is used to convert <see cref="XmlDocument"/>
    /// to the appropriate <see cref="ISyndicationFeed"/>.
    /// </summary>
    public interface IAggregator
    {
        /// <summary>
        /// Gets or sets a reference to the next <see cref="IAggregator"/> in
        /// the aggregators chain.
        /// </summary>
        IAggregator NextAggregator
        { get; set; }

        /// <summary>
        /// Aggregates <paramref name="feedDocument"/> into <paramref name="syndicationFeed"/>.
        /// </summary>
        /// <param name="feedDocument">Feed XML document.</param>
        /// <param name="syndicationFeed">Syndication feed.</param>
        /// <exception cref="ArgumentNullException">
        /// When <paramref name="feedDocument"/> is a <c>null</c> reference.
        /// </exception>
        void Aggregate(XmlDocument feedDocument, ref ISyndicationFeed syndicationFeed);
    }
}
